Heroku.deploy   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 8
c 0
b 0
f 0
rs 10
cc 1
1
2
import Api from './HerokuApi';
3
4
export default class Heroku {
5
    constructor(name, apiKey, logger) {
6
        this.api = new Api(name, apiKey);
7
        this.logger = logger;
8
    }
9
10
    async deploy(file, version) {
11
        const source = await this.api.createSource();
12
13
        await this.api.upload(source.put, file);
14
        const build = await this.api.createBuild(source.get, version);
15
16
        return build.id;
17
    }
18
19
    test() {
20
        return this.api.test();
21
    }
22
}
23